<extend name="Public:base"/>

<block name="main">
<load href="__JS__/swfupload.js"/>

<div id="yzh-content">
    <div class="main-title">
        <h2>基本设置</h2>
    </div>

    <form id="myform" class="form-horizontal" method="post" action="{:U('wap/config')}">

        <div class="form-group">
            <label class="control-label col-md-2">网站名称:</label>
            <div class="col-md-5">
                <input type="text" class="form-control" name="site_company" value="{$wap_config['site_company']}" >
            </div>
        </div>

        <div class="form-group">
            <label class="control-label col-md-2">网站logo:</label>
            <div class="col-md-5">
                <input type="hidden" id="site_wap_logo" name="site_wap_logo"  value="{$wap_config['site_wap_logo']}" />
                <div class="thumb_box">
                    <div id="image_aid_box"></div>
                    <a class="thumbnail" href="javascript:swfupload('logo_uploadfile','site_wap_logo','文件上传',1,1,0,1,'jpeg,jpg,png,gif',3,1,'{$yzh_auth}',yesdo,nodo)">
                        <img height="68" src="<if condition="!empty($wap_config['site_wap_logo'])">{$wap_config['site_wap_logo']}<else/>__IMG__/web_logo.jpg</if>" id="site_wap_logo_pic" >
                    </a>
                    <input type="button" value="取消缩略图" onclick="javascript:clean_thumb('site_wap_logo');" class="btn btn-xs btn-info" />
                </div>
                <label for="">(建议logo高度：34px)</label>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-md-2">百度地图地址:</label>
            <div class="col-md-5">
                <input type="text" class="form-control" name="site_map_address" value="{$wap_config['site_map_address']}" >
            </div>
        </div>

        <div class="form-group">
            <label class="control-label col-md-2">首页二维码:</label>
            <div class="col-md-5">
                <input type="hidden" id="site_qrcode" name="site_qrcode"  value="{$wap_config['site_qrcode']}" />
                <div class="thumb_box" style ="left:500px;width:97px;height:80px;padding:2px;top:-7px;">
                    <div id="image_aid_box"></div>
                    <a href="javascript:swfupload('logo_uploadfile','site_qrcode','文件上传',1,1,0,1,'jpeg,jpg,png,gif',3,1,'{$yzh_auth}',yesdo,nodo)">
                    <img style="width:50px;height: 50px;" width="50" height="50" src="<if condition="!empty($wap_config['site_qrcode'])">{$wap_config['site_qrcode']}<else/>__IMG__/admin_upload_thumb.png</if>" id="site_qrcode_pic" ></a><br>
                    <input type="button" value="取消缩略图" onclick="javascript:clean_thumb('site_qrcode');" class="btn btn-xs btn-info" />
                </div>(建议尺寸：100px*100px)
            </div>
        </div>

        <div class="form-group">
            <label class="control-label col-md-2">服务电话:</label>
            <div class="col-md-5">
                <input type="text" class="form-control" name="site_tel400" value="{$wap_config['site_tel400']}" >
            </div>
        </div>

        <div class="form-actions">
            <input type="submit" value="保存" class="btn btn-sm btn-primary" >
            <input type="reset" value="重置" class="btn btn-sm btn-primary">
        </div>

    </form>

</div>

<script type="text/javascript">
$(document).ready(function() {
  $('#myform').ajaxForm({
    success:  complete,  // post-submit callback
    dataType: 'json'
  });
});

function complete(data){
  if(data.status==1){
    $.scojs_message('修改成功', $.scojs_message.TYPE_OK);

  }else{
    $.scojs_message(data.info, $.scojs_message.TYPE_ERROR);
  }

}
</script>
</block>